//<?php ?>

<INITIAL>"/*"          BEGIN(blockcomment);
<INITIAL>"//"          BEGIN(linecomment);
<INITIAL>"\""          BEGIN(dqstring);
<INITIAL>"class"         BEGIN(class);
<INITIAL>function      BEGIN(func);


<dqstring>"\""         echo "dqstring: [$left]\n"; BEGIN(INITIAL);

<blockcomment>"*/"     BEGIN(INITIAL);

<linecomment>"\n"      BEGIN(INITIAL);


<func>" "
<func>(                echo "func: [$left]\n"; BEGIN(params);


<class>" "
<class>"{"             echo "class: [$left]\n"; BEGIN(INITIAL);


<params>"{"            echo "params: [" . preg_replace("/\)?\s*$/", '', $left) . "]\n"; BEGIN(INITIAL);

